<?php

namespace Project\ScrumBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class CraType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('date', 'date')
            ->add('commentaire','textarea', array(
            "attr" => array("rows"=>15)))
            ->add('userstoriesUserstorie', 'entity', array(
                    'class' => 'Project\ScrumBundle\Entity\Userstories',
                    'property' => 'role',
                    'expanded' => true,
                    'multiple' => true,
                    'label' => 'User story : ',
                ))
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Project\ScrumBundle\Entity\Cra'
        ));
    }

    public function getName()
    {
        return 'project_scrumbundle_cratype';
    }
}
